#include <iostream>
#include <boost/lambda/lambda.hpp>
#include <boost/function.hpp>
#include <boost/typeof/typeof.hpp>
#include <vector>
#include <string>

using namespace std;

class Person
{
public:
    Person(string name) :
        _name(name) {}
    string getName() const {return _name;}
//private:
    string _name;
};

struct find_name{
    find_name(string name): _name(name) {}
    bool operator() (Person &p) const {
        return p.getName() == _name; 
    }
private:
    string _name;
};


int main()
{
    using namespace boost::lambda;
    using namespace std;

    boost::function<int(int)> fun = 12 + 2 * _1; 
    //boost::function<int(void)> fun1 = 12 + 4;
    std::cout << fun(3) << std::endl;
    
    std::vector<int> vec;
    vec.push_back(1);
    vec.push_back(3);
    vec.push_back(2);
    (std::cout << _1[_2] << "\n") (vec, 1);

    BOOST_AUTO(foo, (std::cout << _1 << "\n"));
    foo("hello");
    foo(14);

    vector<Person> vec_1;
    vec_1.push_back(Person("Li"));
    vec_1.push_back(Person("Liu"));
    vec_1.push_back(Person("Jiang"));

        remove_if(vec_1.begin(), vec_1.end(), find_name(string("Liu")));
}
